import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/eims/sale/getGlassesInfoPage',
    method: 'get',
    params: query
  })
}

export function getObj(id) {
  return request({
    url: '/eims/sale/getInfoById/' + id,
    method: 'get'
  })
}

//  根据配镜单号查询配镜单详情
export function getObjByBillId(id) {
  return request({
    url: '/eims/sale/getInfo/' + id,
    method: 'get'
  })
}

export function getInventoryInfo(billId) {
  return request({
    url: '/eims/sale/getOpticianInventoryInfo/' + billId,
    method: 'get'
  })
}


export function getPayInfo(billId) {
  return request({
    url: '/eims/sale/getPaymentRecords/' + billId,
    method: 'get'
  })
}

export function getInTransit(billId) {
  return request({
    url: '/eims/sale/getInTransit/' + billId,
    method: 'get'
  })
}

// 获取配镜单在途状态
export function getSaleStatus() {
  return request({
    url: '/eims/intransit/getList',
    method: 'get'
  })
}

// 获取导出Excel数据
export function getGlassesInfoExport(obj) {
  return request({
    url: '/eims/sale/getGlassesInfo/excel',
    method: 'post',
    data: obj,
    responseType: 'blob'
  })
}
